import ky from 'ky'
import { Gender, Pager, UserState } from '../types'


export type User = {
    id: number,
    name: string
    gender: Gender
    state:  UserState
}

export const getUsers = async (pageNo: number, pageSize: number): Promise<Pager<User>> =>
    ky.get("/apis/users", { searchParams: { pageNo, pageSize } }).json()